package com.wy.Service.impl;

import com.wy.Service.DanyuanService;
import com.wy.dao.DanyuanDao;
import com.wy.pojo.Danyuan;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

@Service("danyuanServer")
@Transactional
public class DanyuanServerimpl implements DanyuanService {
    @Resource
    private DanyuanDao danyuanDao;

    @Override
    public List<Danyuan> searchAll() {
        return danyuanDao.findAll();
    }

    @Override
        public List<Danyuan> searchidAll(Integer louyvid) {
        return danyuanDao.searchidAll(louyvid);
    }

    @Override
    public void del(Integer id) {
        danyuanDao.deleteById(id);
    }
    @Override
    public void add(Danyuan danyuan) {
        danyuanDao.save(danyuan);
    }



}
